//package com.lcke.lemon.flinkcdc;
//
//import com.ververica.cdc.connectors.mysql.source.MySqlSource;
//import com.ververica.cdc.debezium.JsonDebeziumDeserializationSchema;
//import org.apache.flink.api.common.eventtime.WatermarkStrategy;
//import org.apache.flink.configuration.Configuration;
//import org.apache.flink.configuration.RestOptions;
//import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
//
//public class MysqlSourceApp {
//    public static void main(String[] args) throws Exception {
//
//        MySqlSource<String> source = MySqlSource.<String>builder()
//                .hostname("127.0.0.1")
//                .port(3306)
//                .databaseList("test")
//                .tableList("test.table1")
//                .username("root")
//                .password("")
//                .deserializer(new JsonDebeziumDeserializationSchema())
//                .build();
//        Configuration configuration = new Configuration();
//        configuration.setInteger(RestOptions.PORT, 8081);
//        StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment(configuration);
//
//        environment.enableCheckpointing(5000);
//        environment.fromSource(source, WatermarkStrategy.noWatermarks(), "mysql source")
//                .addSink(new CustomSink());
//        environment.execute();
//
//    }
//}
